import 'package:flutter_test/flutter_test.dart';
import 'package:component_call/component_call.dart';
import 'package:component_call/component_call_platform_interface.dart';
import 'package:component_call/component_call_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockComponentCallPlatform
    with MockPlatformInterfaceMixin
    implements ComponentCallPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final ComponentCallPlatform initialPlatform = ComponentCallPlatform.instance;

  test('$MethodChannelComponentCall is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelComponentCall>());
  });

  test('getPlatformVersion', () async {
    ComponentCall componentCallPlugin = ComponentCall();
    MockComponentCallPlatform fakePlatform = MockComponentCallPlatform();
    ComponentCallPlatform.instance = fakePlatform;

    expect(await componentCallPlugin.getPlatformVersion(), '42');
  });
}
